
default_platform(:ios)

platform :ios do
  desc "fastlane build env:test/stage/release"
  lane :build do |options|
    xcode_select "/Applications/Xcode.app"
    #build_number = get_build_number(xcodeproj: "CommonPro.xcodeproj")
    #version = get_version_number(xcodeproj: "CommonPro.xcodeproj")
    time = Time.new

    out_put_path = File.expand_path("..")+"/build"
    env = options[:env]
    scheme = "CommonPro" + env
  
    print out_put_path
    gym(
      workspace: "CommonPro.xcworkspace",
      scheme: scheme,
      clean: true,
      output_directory: out_put_path,
      output_name: "TT"+env + "-" + time.strftime("%Y%m%d%H%M") + "-realease",
      configuration: env,
      silent: true,
      include_symbols: true,
      include_bitcode: false,
      export_method: "enterprise",
      )
  end
end
